package com.zankong.tool.zkapp.v8fn.socket_pck;

/**
 * Created by YF on 2018/4/9.
 */

public class SocketObj {
    private String mMethod = "";//method  事件
    private OnCallBack mCallBack;//java回调
    private String mEvent = "";//调用on|off|emit....
    private Object[] mObject;




    public interface OnCallBack{
        void invoke(Object[] obj);
    }
    private SocketObj(){}
    public SocketObj(Builder builder){
        mMethod = builder.mMethod;
        mCallBack = builder.mCallBack;
        mEvent = builder.mEvent;
        mObject = builder.mObject;
    }

    public Object[] getObject() {
        return mObject;
    }

    public void setObject(Object[] object) {
        mObject = object;
    }

    public String getMethod() {
        return mMethod;
    }

    public void setMethod(String method) {
        mMethod = method;
    }

    public OnCallBack getCallBack() {
        return mCallBack;
    }

    public void setCallBack(OnCallBack callBack) {
        mCallBack = callBack;
    }

    public String getEvent() {
        return mEvent;
    }

    public void setEvent(String event) {
        mEvent = event;
    }

    public static class Builder{
        private String mMethod = "";
        private OnCallBack mCallBack;
        private String mEvent = "";
        private Object[] mObject;






        public Builder(){};
        public SocketObj build(){
            return new SocketObj(this);
        }

        public Builder addMethod(String method){
            this.mMethod = method;
            return this;
        }
        public Builder addCallBack(OnCallBack callBack){
            this.mCallBack = callBack;
            return this;
        }
        public Builder addEvent(String event){
            this.mEvent = event;
            return this;
        };
        public Builder addObjects(Object ...objects){
            this.mObject = objects;
            return this;
        }
    }



}
